import request from '@/utils/request'

// 用户登录
export function login(data) {
  return request({
    url: '/api/Home/Login',
    method: 'post',
    params: data
  })
}

// 获取用户
export function getInfo(token) {
  return request({
    url: '/vue-element-admin/user/info',
    method: 'get',
    params: { token }
  })
}

// 用户登出
export function logout(data, token) {
  return request({
    url: '/api/Home/Logout',
    method: 'post',
    params: data,
    headers: {
      'Authorization': 'Bearer ' + token
    }
  })
}

// 用户权限
export function userPermission(data) {
  return request({
    url: '/api/System/UserPermission/' + data,
    method: 'get',
    params: { id: data },
  })
}
